const modules = {
  common: {
    get_env_params: 'get_env_params',
    deeplink: 'deeplink',
    clear_env_params_deeplink: 'clear_env_params_deeplink',
    system_theme_change: 'system_theme_change',
    theme_change: 'theme_change',
    get_system_fonts: 'get_system_fonts',
    get_app_setting: 'get_app_setting',
    set_app_setting: 'set_app_setting',
  },
  winMain: {
    focus: 'focus',
    close: 'close',
    min: 'min',
    max: 'max',
    unmaximize: 'unmaximize',
    fullscreen: 'fullscreen',
    set_app_name: 'set_app_name',
    clear_cache: 'clear_cache',
    get_cache_size: 'get_cache_size',
    inited: 'inited',
    show_save_dialog: 'show_save_dialog',
    show_select_dialog: 'show_select_dialog',
    show_dialog: 'show_dialog',
    open_dir_in_explorer: 'open_dir_in_explorer',
    open_dev_tools: 'open_dev_tools',
    set_power_save_blocker: 'set_power_save_blocker',

    quit_update: 'quit_update',
    update_check: 'update_check',
    update_download_update: 'update_download_update',
    update_available: 'update_available',
    update_error: 'update_error',
    update_progress: 'update_progress',
    update_downloaded: 'update_downloaded',
    update_not_available: 'update_not_available',
    set_window_size: 'set_window_size',

    handle_request: 'handle_request',
    cancel_request: 'cancel_request',

    restart_window: 'restart_window',
    // lang_s2t: 'lang_s2t',

    on_config_change: 'on_config_change',
    key_down: 'key_down',
    quit: 'quit',
    min_toggle: 'min_toggle',
    hide_toggle: 'hide_toggle',

    download_list_get: 'download_list_get',
    download_list_add: 'download_list_add',
    download_list_update: 'download_list_update',
    download_list_remove: 'download_list_remove',
    download_list_clear: 'download_list_clear',

    //登录
    login: 'login',
    loginSuccess: 'loginSuccess',
    loginOut: 'loginOut',
    updatePassword: 'updatePassword',

    //标注信息
    addMarkInfo: 'addMarkInfo',

    // 实时监控
    addRealTimeMarkInfo: 'addRealTimeMarkInfo',
    addRealTimeMarkItem: 'addRealTimeMarkItem',

    //获取文件大小
    getFileSize: 'getFileSize',

    //视频列表
    getVideoInfoQuery: 'getVideoInfoQuery',
    getVideoInfoListCount: 'getVideoInfoListCount',
    addVideo: 'addVideo',
    deleteVideo: 'deleteVideo',
    getChannelFromDb: 'getChannelFromDb',

    //视频标注列表
    getVideoMarkListByVedioId: 'getVideoMarkListByVedioId',
    getRightMarkListByVideoId: 'getRightMarkListByVideoId',
    deleteMarkInfo: 'deleteMarkInfo',
    addMarkItemInfo: 'addMarkItemInfo',
    selectVideoListByIds: 'selectVideoListByIds',

    //视频标注
    getTextMarkInfoQuery: 'getTextMarkInfoQuery',
    getTextMarkInfoQueryCount: 'getTextMarkInfoQueryCount',
    deleteMark: 'deleteMark',
  },
};

for (const moduleName of Object.keys(modules) as Array<keyof typeof modules>) {
  let eventNames = modules[moduleName];
  for (const eventName of Object.keys(eventNames) as Array<keyof typeof eventNames>) {
    eventNames[eventName] = `${moduleName}_${eventName as string}` as never;
  }
}

// for (const moduleName of Object.keys(modules) as Array<keyof typeof modules>) {
//   let eventNames = modules[moduleName]
//   for (const eventName of Object.keys(eventNames)) {
//     eventNames[eventName] = `${moduleName}_${eventName}`
//   }
// }

export const CMMON_EVENT_NAME = modules.common;
export const WIN_MAIN_RENDERER_EVENT_NAME = modules.winMain;
